package com.oamicnet.serviceone.server.api;

import com.oamicnet.serviceone.api.teacher.TeacherApi;
import com.oamicnet.serviceone.api.teacher.vo.TeacherVO;
import com.oamicnet.serviceone.server.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TeacherApiImpl implements TeacherApi {

    @Autowired
    public TeacherService teacherService;

    @Override
    public TeacherVO getTeacherById(Long id) {
        return  teacherService.get(id);
    }

    @Override
    public void saveTeacher(TeacherVO teacher) {
        teacherService.save(teacher);
    }

    @Override
    public void updateTeacher(TeacherVO teacher) {
        teacherService.update(teacher);
    }
}
